<?php
/**
 * Created by PhpStorm.
 * User: EDZ
 * Date: 2020/6/22
 * Time: 14:06
 */

namespace DesignPatterns\Creative\AbstractFactory;
use utils\Str;


class ShapeFactory extends AbstractFactory
{
    public function getColor(string $color) : Color {
        return null;
    }

    public function getShape(string $shapeType) : Shape {
        if (empty($shapeType)) {
            return null;
        }
        if (Str::equalsIgnoreCase($shapeType, "CIRCLE")) {
            return new Circle();
        } else if (Str::equalsIgnoreCase($shapeType, "RECTANGLE")) {
            return new Rectangle();
        } else if (Str::equalsIgnoreCase($shapeType, "SQUARE")) {
            return new Square();
        }
        return null;
    }
}